<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>7_文本溢出替换为省略号</title>
    <style>
        div{
            background-color: #ff0;
            width: 300px;
            /*必须设置所在区域的大小*/
            white-space: nowrap;/*禁止换行*/
            overflow: hidden;/*超出隐藏*/
            text-overflow: ellipsis;/*文本溢出显示省略号*/
        }
    </style>
</head>
<body>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi doloribus dolorum et ipsa magnam nisi nobis nostrum
    recusandae! Ad consectetur delectus deserunt in ipsam natus obcaecati quisquam quod, tempora! Magni.
</div>


</body>
</html>